package com.jzh.selfwallpaper.view.activity;

import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.WindowManager;

import com.jzh.selfwallpaper.R;
import com.jzh.selfwallpaper.entity.RaceLightConfig;
import com.jzh.selfwallpaper.view.widget.MarqueeView;

import static com.jzh.selfwallpaper.constant.Constant.RACE_LIGHT_FLAG;

public class RaceLightPlayActivity extends Activity {

    private float size = 600.0f;
    private RaceLightConfig raceLightConfig;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_race_light_play);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// 去掉手机显示电池，时间和网络

        Intent intent = getIntent();
        if (intent != null) {
            Bundle bundle = intent.getExtras();
            if (bundle != null) {
                raceLightConfig = (RaceLightConfig) bundle.getParcelable(RACE_LIGHT_FLAG);
            }
        }
        Log.i("mkmkmk", raceLightConfig == null ? "空" : raceLightConfig.toString());
        MarqueeView marqueeView = (MarqueeView) findViewById(R.id.mv_race_light);
        marqueeView.setFocusable(true);
        marqueeView.requestFocus();
        marqueeView.setmTextColor(getResources().getColor(raceLightConfig.color==0?R.color.A2:raceLightConfig.color));
        marqueeView.setmTextSize(raceLightConfig == null ? 600: raceLightConfig.size);
        marqueeView.setText(raceLightConfig == null ? "你好" : raceLightConfig.text);//设置文本
        marqueeView.startScroll(); //开始
    }

}
